package client;

import gui.Login;
import java.net.Socket;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author Sasa
 */
public class Client {

    public static void main(String[] args) throws Exception {
        try {
                    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
            }catch (UnsupportedLookAndFeelException e) {}
             catch (ClassNotFoundException e) {}
             catch (InstantiationException e) {}
             catch (IllegalAccessException e) {}
        try {
            Socket socket = new Socket("localhost", 9876);
            socket.setKeepAlive(true);
            Requests req = new Requests(socket);
            new Login(req);
        } catch (Exception e) {
            System.out.println(e);
            JOptionPane.showMessageDialog(new JFrame(), "Could not connect to server.");
            System.exit(0);
        }
    }
}
